package com.example.luozizhao.eprxdemo.net.bean;

import com.example.luozizhao.eprxdemo.commom.CSUrl;
import com.example.luozizhao.eprxdemo.net.bean.base.BasicDataBean;
import com.example.luozizhao.eprxdemo.utils.SPManager;

import java.io.Serializable;

/**
 * 〈一句话功能简述〉 〈功能详细描述〉
 *
 * @author lixiangsong
 * @version ${VERSIONNAME}
 * @date 2016/7/8
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */

public class LocationStationBean implements Serializable, Comparable<LocationStationBean>,BasicDataBean {

    private static final String CODE="station";
    private static final long serialVersionUID = -65121507964788071L;

    // 组织id
    private int orgId;

    // 子机构id
    private int pid;

    // 地铁站名字
    private String name;
    
    //标志是否是最近的
    private boolean first = false;

    public boolean isFirst() {
        return first;
    }

    public void setFirst(boolean first) {
        this.first = first;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    private String location;

    private Double distance = 0d;

    public int getOrgId() {
        return orgId;
    }

    public void setOrgId(int orgId) {
        this.orgId = orgId;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    @Override
    public String toString() {
        return "LocationStationBean{" + "orgId=" + orgId + ", pid=" + pid + ", name='" + name + '\'' + ", location='"
                + location + '\'' + '}';
    }

    @Override
    public int compareTo(LocationStationBean bean) {
        double result = this.getDistance() - bean.getDistance();
        return result == 0 ? 0 : result > 0 ? 1 : -1;
    }

    @Override
    public String getLoadUrl() {
        return CSUrl.GET_STATION;
    }

    @Override
    public int getVersion() {
        return SPManager.App.getDataVersion(CODE);
    }

    @Override
    public String getCode() {
        return CODE;
    }
}
